
package tests;

import static org.junit.Assert.*;

import io.DataAccess;

import org.junit.Before;
import org.junit.Test;

/**
 * Junit test for the DataAccessTest class.
 * 
 * @author Christopher M. Augg
 * @version 3/19/2014
 */
public class DataAccessTest {

  /** DataAccess object for connecting to Conference.xml. */
  private DataAccess my_access;

  /**
   * The constructor to instantiate the DataAccess objects.
   * 
   * @throws Exception throws an exception if constructions failed.
   */
  @Before
  public void setUp() throws Exception {
    my_access = new DataAccess();

  }

  /**
   * Primary test to make sure object is instantiated.
   */
  @Test
  public void test() {
    assertNotNull(my_access);
  }

  /** Tests the accessConf method. */
  @Test
  public void accessConf() {
    assertNotNull(" I do not have access to ConferenceAccess",
                  my_access.accessConf().getClass());
  }

  /** Tests the accessManRec method. */
  @Test
  public void accessManRec() {
    assertNotNull(" I do not have access to ManHasRecAccess",
                  my_access.accessManRec().getClass());
  }

  /** Tests the accessManRev method. */
  @Test
  public void accessManRev() {
    assertNotNull(" I do not have access to ManHasRevAccess",
                  my_access.accessManRev().getClass());
  }

  /** Tests the accessManuscript method. */
  @Test
  public void accessManuscript() {
    assertNotNull(" I do not have access to ManuscriptAccess",
                  my_access.accessManuscript().getClass());
  }

  /** Tests the accessRec method. */
  @Test
  public void accessRec() {
    assertNotNull(" I do not have access to RecommendationAccess",
                  my_access.accessRec().getClass());
  }

  /** Tests the accessRev method. */
  @Test
  public void accessRev() {
    assertNotNull(" I do not have access to ReviewAccess",
                  my_access.accessRev().getClass());
  }

  /** Tests the accessRole method. */
  @Test
  public void accessRole() {
    assertNotNull(" I do not have access to RoleAccess",
                  my_access.accessRole().getClass());
  }

  /** Tests the accessUser method. */
  @Test
  public void accessUser() {
    assertNotNull(" I do not have access to UserAccess",
                  my_access.accessUser().getClass());
  }

  /** Tests the accessUserConfMan method. */
  @Test
  public void accessUserConfMan() {
    assertNotNull(" I do not have access to UserHasConfManAccess",
                  my_access.accessUserConfMan().getClass());
  }

  /** Tests the accessUserConfRole method. */
  @Test
  public void accessUserConfRole() {
    assertNotNull(" I do not have access to UserHasConfroleAccess",
                  my_access.accessUserConfRole().getClass());
  }

  /** Tests the getUserData method. */
  @Test
  public void getUserData() {
    assertNotNull(" I do not have access to user data",
                  my_access.getUserData("Chris", "Augg"));
  }
}
